import Layout from "@/layout";
import EmptyView from "@/layout/secondary";

const exampleRouter = [
    {
        path: "example",
        component: Layout,
        redirect: "noRedirect",
        name: "example",
        children: [
            {
                path: "page",
                name: "FullExample",
                component: EmptyView,
                children: [
                    {
                        path: "create",
                        component: () => import("@/views/example/create"),
                        name: "CreateArticle",
                    },
                    {
                        path: "401",
                        component: () => import("@/views/error-page/401"),
                        name: "Page401",
                        meta: { title: "401", noCache: true },
                    },
                    {
                        path: "404",
                        component: () => import("@/views/error-page/404"),
                        name: "Page404",
                        meta: { title: "404", noCache: true },
                    },
                ],
            },
            {
                path: "chart",
                name: "ChartExample",
                component: EmptyView,
                children: [
                    {
                        path: "keyboard",
                        component: () => import("@/views/charts/keyboard"),
                        name: "KeyboardChart",
                    },
                    {
                        path: "line",
                        component: () => import("@/views/charts/line"),
                        name: "LineChart",
                    },
                    {
                        path: "mix-chart",
                        component: () => import("@/views/charts/mix-chart"),
                        name: "MixChart",
                    },
                ],
            },
            {
                name: "Component",
                path: "component",
                component: EmptyView,
                children: [
                    {
                        path: "tinymce",
                        component: () =>
                            import("@/views/components-demo/tinymce"),
                        name: "Tinymce",
                    },
                    {
                        path: "json-editor",
                        component: () =>
                            import("@/views/components-demo/json-editor"),
                        name: "JsonEditor",
                    },
                    {
                        path: "index",
                        component: () => import("@/views/icons/index"),
                        name: "Icons",
                    },
                    {
                        path: "edit/:id(\\d+)",
                        component: () => import("@/views/example/edit"),
                        name: "EditArticle",
                        hidden: true,
                    },
                    {
                        path: "split-pane",
                        component: () =>
                            import("@/views/components-demo/split-pane"),
                        name: "SplitPane",
                    },
                    {
                        path: "sticky",
                        component: () =>
                            import("@/views/components-demo/sticky"),
                        name: "StickyDemo",
                    },
                    {
                        path: "count-to",
                        component: () =>
                            import("@/views/components-demo/count-to"),
                        name: "CountTo",
                        meta: { title: "Count To" },
                    },
                    {
                        path: "avatar-upload",
                        component: () =>
                            import("@/views/components-demo/avatar-upload"),
                        name: "AvatarUpload",
                    },
                    {
                        path: "dropzone",
                        component: () =>
                            import("@/views/components-demo/dropzone"),
                        name: "Dropzone",
                    },
                    // 暂时不用
                    {
                        path: "mixin",
                        component: () =>
                            import("@/views/components-demo/mixin"),
                        name: "ComponentMixinDemo",
                    },
                    {
                        path: "back-to-top",
                        component: () =>
                            import("@/views/components-demo/back-to-top"),
                        name: "BackToTop",
                    },
                    {
                        path: "drag-dialog",
                        component: () =>
                            import("@/views/components-demo/drag-dialog"),
                        name: "DragDialog",
                    },
                    {
                        path: "drag-select",
                        component: () =>
                            import("@/views/components-demo/drag-select"),
                        name: "DragSelect",
                    },
                    {
                        path: "dnd-list",
                        component: () =>
                            import("@/views/components-demo/dnd-list"),
                        name: "DndList",
                    },
                ],
            },
        ],
    },

    {
        path: "external-link",
        name: "External",
        component: Layout,
        children: [
            {
                path: "https://github.com/PanJiaChen/vue-element-admin",
                name: "Github",
            },
            {
                path: "http://www.suhaoblog.cn",
                name: "Rambler",
            },
        ],
    },
];

export default exampleRouter;
